/**
 * Created by maxiaoqiang on 2018/4/10.
 */
import {
    createStore,
    applyMiddleware
} from 'redux';

// import logger from 'redux-logger';
import reducers from './reducers/index';
import rootSaga from './sagas/index';
import createSagaMiddleware from 'redux-saga';

const sagaMiddleware = createSagaMiddleware();

// const middleWares = [logger, sagaMiddleware];
const middleWares = [sagaMiddleware];
// const middleWares = [logger];

export const store = createStore(reducers, applyMiddleware(...middleWares));
sagaMiddleware.run(rootSaga);